﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using YAPL.Language.Ast;
using YAPL.Util;

namespace YAPL.Language.SourceParser.XML.NodeParsers {
	public class XmlClassReferenceParser : XmlExpressionParser {
		public XmlClassReferenceParser(XmlInputParser parser) : base(parser) { }
		public override Expression ParseNode(XElement node) {
			var name = node.Attribute(XmlNames.IdentifierNameAttribute);
			Require.NotNull(name);
			Require.NotEmpty(name.Value);
			return Expressions.ClassReference(name.Value);
		}
	}
}
